<?php

namespace App\Http\Requests\Api\v1;

use App\Http\Requests\BaseRequest;

class MachineOrdersRequest extends BaseRequest
{
    public array $scenes = [
        'createOrders' => ['device_no', 'order_type'],
        'cancelOrders' => ['id'],
        'payOrders' => ['order_no', 'order_id','pay_password'],
        'ordersInfo' => ['id'],
        'ordersDelete' => ['id'],
        'operation' => ['order_no','command']
    ];

    public function rules()
    {
        return [
            'machine_type' => 'required',
            'pay_password' => 'required',
            'device_no' => 'required',
            'order_type' => 'required',
            'id' => 'required',
            'order_no' => 'required',
            'order_id' => 'required',
            'command' => 'required',
        ];
    }

    public function messages(): array
    {
        return [
            'machine_type.required' => '机器类型不能为空',
            'device_no.required' => '机器设备号不能为空',
            'order_type.required' => '服务类型不能为空',
            'id.required' => 'ID不能为空',
            'order_no.required' => '订单号不能为空',
            'order_id.required' => '订单ID不能为空',
            'pay_password.required' => '支付密码不能为空',
            'command.required' => '操作不能为空',
        ];
    }
}
